package study.mq.kafka.consumer.listener._4_delivery;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class P2P_02_Listener {

//    @KafkaListener(topics = "topic-2", groupId = "aaaaaa")
    public void onMessage1(ConsumerRecord<String, String> record, Consumer consumer) {
        //
        String topic = record.topic();
        int partition = record.partition();
        String key = record.key();
        long offset = record.offset();

        log.info("[{}, {}] offset= {}", topic, partition, offset);
    }
}
